var express = require('express');
const { get } = require('mongoose');
var router = express.Router();

const { getLessors, frozenAccount, thawAccount } = require("../service/lessorsService");
//获取出租方信息 
router.get('/getLessors', async function (req, res, next) {
    const lessors = req.query;
    const data = await getLessors(lessors);
    res.send({
        status: 1,
        data,
        message: "获取出方信息成功！"
    })
});

//冻结账户
router.post('/frozenAccount', async function (req, res, next) {
    const frozen = req.body;
    const data = await frozenAccount(frozen);
    res.send({
        status: 1,
        data,
        message: "操作成功！"
    })
});

//解冻账户
router.post('/thawAccount', async function (req, res, next) {
    const thaw = req.body;
    const data = await thawAccount(thaw);
    res.send({
        status: 1,
        data,
        message: "操作成功！"
    })
});

module.exports = router;
